home *** CD-ROM | disk | FTP | other *** search
Wrap
global gSize, gCast, gHotspotPoint, g4bitValues on saveAsIcon SaveFileName = baGetFilename("save", EMPTY, "untitled", "Icon files (*.ico)|*.ico", 2 + 4 + 8 + 32 + 524288, "Save Icon", 0, -1, 0) if SaveFileName = EMPTY then pass() else ImageExportXtra = new(xtra("RAVIMAGEEXPORT")) if objectp(ImageExportXtra) = 0 then alert("Could not save icon!") else RavRegisterImageExport(ImageExportXtra, "R100-72-57970312") if gCast = "4bit" then transColor = 15 - getProp(g4bitValues, sprite(36).member.image.getPixel(0, 0, #integer)) XorColor = 15 - getProp(g4bitValues, sprite(37).member.image.getPixel(0, 0, #integer)) else transColor = 255 - sprite(36).member.image.getPixel(0, 0, #integer) XorColor = 255 - sprite(37).member.image.getPixel(0, 0, #integer) end if if sprite(36).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateTranMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOTranMaskIndex, transColor) end if if sprite(37).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateXorMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOXorMaskIndex, XorColor) end if if gCast = "4bit" then member(gSize & "x" & gSize & "x4").image.copyPixels(member(gSize & "x" & gSize, gCast).image, member(gSize & "x" & gSize, gCast).rect, member(gSize & "x" & gSize, gCast).rect) if RavSaveCastMemberFromName(ImageExportXtra, gSize & "x" & gSize & "x4", SaveFileName, 0, 0, 4, #ravICO) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if else if RavSaveCastMemberFromIndex(ImageExportXtra, member(gSize & "x" & gSize, gCast).memberNum, member(gSize & "x" & gSize, gCast).castLibNum, SaveFileName, 0, 0, 8, #ravICO) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if end if member("revert - " & gSize, gCast).image = duplicate(member(gSize & "x" & gSize, gCast).image) put SaveFileName into field "file status" ImageExportXtra = 0 end if end if end on saveIcon if the text of field "file status" = EMPTY then saveAsIcon() else ImageExportXtra = new(xtra("RAVIMAGEEXPORT")) if objectp(ImageExportXtra) = 0 then alert("Could not save icon!") else RavRegisterImageExport(ImageExportXtra, "R100-72-57970312") if gCast = "4bit" then transColor = 15 - getProp(g4bitValues, sprite(36).member.image.getPixel(0, 0, #integer)) XorColor = 15 - getProp(g4bitValues, sprite(37).member.image.getPixel(0, 0, #integer)) else transColor = 255 - sprite(36).member.image.getPixel(0, 0, #integer) XorColor = 255 - sprite(37).member.image.getPixel(0, 0, #integer) end if if sprite(36).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateTranMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOTranMaskIndex, transColor) end if if sprite(37).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateXorMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOXorMaskIndex, XorColor) end if if gCast = "4bit" then member(gSize & "x" & gSize & "x4").image.copyPixels(member(gSize & "x" & gSize, gCast).image, member(gSize & "x" & gSize, gCast).rect, member(gSize & "x" & gSize, gCast).rect) if RavSaveCastMemberFromName(ImageExportXtra, gSize & "x" & gSize & "x4", the text of field "file status", 0, 0, 4, #ravICO) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if else if RavSaveCastMemberFromIndex(ImageExportXtra, member(gSize & "x" & gSize, gCast).memberNum, member(gSize & "x" & gSize, gCast).castLibNum, the text of field "file status", 0, 0, 8, #ravICO) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if end if member("revert - " & gSize, gCast).image = duplicate(member(gSize & "x" & gSize, gCast).image) ImageExportXtra = 0 end if end if end on saveAsCursor SaveFileName = baGetFilename("save", EMPTY, "untitled", "Cursor files (*.cur)|*.cur", 2 + 4 + 8 + 32 + 524288, "Save Cursor", 0, -1, 0) if SaveFileName = EMPTY then pass() else ImageExportXtra = new(xtra("RAVIMAGEEXPORT")) if objectp(ImageExportXtra) = 0 then alert("Could not save cursor!") else RavRegisterImageExport(ImageExportXtra, "R100-72-57970312") if gCast = "4bit" then transColor = 15 - getProp(g4bitValues, sprite(36).member.image.getPixel(0, 0, #integer)) XorColor = 15 - getProp(g4bitValues, sprite(37).member.image.getPixel(0, 0, #integer)) else transColor = 255 - sprite(36).member.image.getPixel(0, 0, #integer) XorColor = 255 - sprite(37).member.image.getPixel(0, 0, #integer) end if if sprite(36).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateTranMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOTranMaskIndex, transColor) end if if sprite(37).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateXorMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOXorMaskIndex, XorColor) end if RavSetProp(ImageExportXtra, #ravCURHotspot, gHotspotPoint) if gCast = "4bit" then member(gSize & "x" & gSize & "x4").image.copyPixels(member(gSize & "x" & gSize, gCast).image, member(gSize & "x" & gSize, gCast).rect, member(gSize & "x" & gSize, gCast).rect) if RavSaveCastMemberFromName(ImageExportXtra, gSize & "x" & gSize & "x4", SaveFileName, 0, 0, 4, #ravCUR) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if else if RavSaveCastMemberFromIndex(ImageExportXtra, member(gSize & "x" & gSize, gCast).memberNum, member(gSize & "x" & gSize, gCast).castLibNum, SaveFileName, 0, 0, 8, #ravCUR) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if end if member("revert - " & gSize, gCast).image = duplicate(member(gSize & "x" & gSize, gCast).image) put SaveFileName into field "file status" ImageExportXtra = 0 end if end if end on saveCursor if the text of field "file status" = EMPTY then saveAsCursor() else ImageExportXtra = new(xtra("RAVIMAGEEXPORT")) if objectp(ImageExportXtra) = 0 then alert("Could not save cursor!") else RavRegisterImageExport(ImageExportXtra, "R100-72-57970312") if gCast = "4bit" then transColor = 15 - getProp(g4bitValues, sprite(36).member.image.getPixel(0, 0, #integer)) XorColor = 15 - getProp(g4bitValues, sprite(37).member.image.getPixel(0, 0, #integer)) else transColor = 255 - sprite(36).member.image.getPixel(0, 0, #integer) XorColor = 255 - sprite(37).member.image.getPixel(0, 0, #integer) end if if sprite(36).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateTranMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOTranMaskIndex, transColor) end if if sprite(37).blend = 100 then RavSetProp(ImageExportXtra, #ravICOGenerateXorMask, #ravICOColor) RavSetProp(ImageExportXtra, #ravICOXorMaskIndex, XorColor) end if RavSetProp(ImageExportXtra, #ravCURHotspot, gHotspotPoint) if gCast = "4bit" then member(gSize & "x" & gSize & "x4").image.copyPixels(member(gSize & "x" & gSize, gCast).image, member(gSize & "x" & gSize, gCast).rect, member(gSize & "x" & gSize, gCast).rect) if RavSaveCastMemberFromName(ImageExportXtra, gSize & "x" & gSize & "x4", the text of field "file status", 0, 0, 4, #ravCUR) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if else if RavSaveCastMemberFromIndex(ImageExportXtra, member(gSize & "x" & gSize, gCast).memberNum, member(gSize & "x" & gSize, gCast).castLibNum, the text of field "file status", 0, 0, 8, #ravCUR) = #false then alert("Error: " & RavGetProp(ImageExportXtra, #ravLastErrorCodeString)) end if end if member("revert - " & gSize, gCast).image = duplicate(member(gSize & "x" & gSize, gCast).image) ImageExportXtra = 0 end if end if end